package com.google.code.geocoder.model;

import java.io.Serializable;

public class DirectionsStep implements Serializable {
    private static final long serialVersionUID = 1L;

    private String travelMode;
    private LatLng startLocation;
    private LatLng endLocation;
    //"polyline": {
    //        "points": "a~l~Fjk~uOwHJy@P"
    //}
    private DirectionsDuration duration;
    private String htmlInstructions;
    private DirectionsDistance distance;

    public String getTravelMode() {
        return travelMode;
    }

    public void setTravelMode(String travelMode) {
        this.travelMode = travelMode;
    }

    public LatLng getStartLocation() {
        return startLocation;
    }

    public void setStartLocation(LatLng startLocation) {
        this.startLocation = startLocation;
    }

    public LatLng getEndLocation() {
        return endLocation;
    }

    public void setEndLocation(LatLng endLocation) {
        this.endLocation = endLocation;
    }

    public DirectionsDuration getDuration() {
        return duration;
    }

    public void setDuration(DirectionsDuration duration) {
        this.duration = duration;
    }

    public String getHtmlInstructions() {
        return htmlInstructions;
    }

    public void setHtmlInstructions(String htmlInstructions) {
        this.htmlInstructions = htmlInstructions;
    }

    public DirectionsDistance getDistance() {
        return distance;
    }

    public void setDistance(DirectionsDistance distance) {
        this.distance = distance;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        DirectionsStep that = (DirectionsStep) o;

        if (distance != null ? !distance.equals(that.distance) : that.distance != null) return false;
        if (duration != null ? !duration.equals(that.duration) : that.duration != null) return false;
        if (endLocation != null ? !endLocation.equals(that.endLocation) : that.endLocation != null) return false;
        if (htmlInstructions != null ? !htmlInstructions.equals(that.htmlInstructions) : that.htmlInstructions != null)
            return false;
        if (startLocation != null ? !startLocation.equals(that.startLocation) : that.startLocation != null)
            return false;
        if (travelMode != null ? !travelMode.equals(that.travelMode) : that.travelMode != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = travelMode != null ? travelMode.hashCode() : 0;
        result = 31 * result + (startLocation != null ? startLocation.hashCode() : 0);
        result = 31 * result + (endLocation != null ? endLocation.hashCode() : 0);
        result = 31 * result + (duration != null ? duration.hashCode() : 0);
        result = 31 * result + (htmlInstructions != null ? htmlInstructions.hashCode() : 0);
        result = 31 * result + (distance != null ? distance.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return "DirectionsStep{" +
                "travelMode='" + travelMode + '\'' +
                ", startLocation=" + startLocation +
                ", endLocation=" + endLocation +
                ", duration=" + duration +
                ", htmlInstructions='" + htmlInstructions + '\'' +
                ", distance=" + distance +
                '}';
    }
}
